package com.bdqn.boot.yuanshen.service;

import com.bdqn.boot.yuanshen.bean.Videos;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

/**
 * @author Hasee
 * @version 1.0
 * @className MinioService
 * @description TODD
 * @date 2025/3/5 11:06
 */
public interface MinioService {
    /**
     * 上传文件到 MinIO
     */
    public String uploadFile(String bucket, String fileName, InputStream inputStream, String contentType);

    /**
     * 获取文件访问地址
     */
    public String getFileUrl(String bucket, String fileName);

    /**
     *  删除文件
     */
    public boolean deleteFile(String bucket, String fileName);

    /**
     * 根据文件的名字来存入数据库
     */
    public void saveVideoInfoToDatabase(String fileName, String title, String description, String videoUrl, String coverUrl);

    public String uploadVideo(String bucket, MultipartFile file, String title, String description, String coverUrl);

    public boolean deleteVideo(String bucket, String fileName, int videoId);

    public boolean deleteFileFromMinio(String bucket, String fileName);

    public boolean updateVideo(Videos video, MultipartFile newFile);

}